package com.glw.sso.platform.domain.feign;

import com.glw.sso.platform.domain.feign.response.JuheResponse;
import com.glw.sso.platform.domain.feign.response.WeatherInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Author: guoliwei
 * @Date: 2021/12/17 23:29
 * @Version 1.0
 */
@Slf4j
@Component
public class WeatherRemoteApiFallback implements WeatherRemoteApi {

    @Override
    public JuheResponse<WeatherInfo> weatherQuery(Map<String, Object> param) {
        log.info("weatherQuery fallback {}", param);
        return JuheResponse
                .<WeatherInfo>builder()
                .errorCode(302)
                .reason("触发熔断")
                .result(new WeatherInfo())
                .build();
    }
}
